#include "RB_Tree.h"

namespace My
{
    template<class K>
    class set
    {
        struct KeySet
        {
            const K& operator()(const K& k)
            {
                return k;
            }
        };
    public:
        typedef typename RB_Tree<K, K, KeySet>::iterator iterator;
        iterator begin() { return _tree.begin(); }
        iterator end() { return _tree.end(); }
        pair<iterator, bool> insert(const K& k) { return _tree.insert(k); }

        K& operator[](const K& k)
        {
            pair<iterator, bool> ret = insert(k);
            return *(ret.first);
        }

    private:
        RB_Tree<K, K, KeySet> _tree;
    };
}
